package com.base.cn.platform.os.service.course.mould;

import com.base.cn.platform.os.service.FeignAuthConfig;
import com.base.cn.platform.os.service.course.CourseBaseService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 模块接口
 *
 * @author s.li
 * @create 2018-04-23-19:52
 */
@FeignClient(name = CourseBaseService.appName,configuration = FeignAuthConfig.class)
public interface CouMouldService extends CourseBaseService {
    /**
     * 查询模块数量
     * @param couMouldCondition
     * @return 数量
     */
    @RequestMapping(contextPath + "/mouldCount")
    BigDecimal mouldCount(@RequestBody Map<String, Object> couMouldCondition);
    /**
     * 保存模块数据
     * @param couMould 模块数据对象
     * @return  CouMould
     */
    @RequestMapping(contextPath + "/saveMould")
    Map<String,Object> saveMould(@RequestBody Map<String, Object> couMould);

    /**
     * 修改模块状态
     * @param ids
     * @param status 状态，1未发布，2已发布，3隐藏
     * @return Map<String,Object>
     */
    @RequestMapping(contextPath + "/updateCouMouldStatus")
    Map<String,Object> updateCouMouldStatus(@RequestParam("ids") String ids, @RequestParam("status") int status);

    /**
     * 设置模块完成
     * @param ids
     * @return Map<String,Object>
     */
    @RequestMapping(contextPath + "/updateMouldFinishStatus")
    Map<String,Object> updateMouldFinishStatus(@RequestParam("ids") String ids);

    /**
     * 通过ID查询模块对象数据
     * @param id
     * @param subjectData 是否设置专业数据
     * @param createUserData 是否设置创建用户数据
     * @param materialData 是否设置素材
     * @return
     */
    @RequestMapping(contextPath + "/findCouMouldById")
    Map<String,Object> findCouMouldById(@RequestParam("id") BigDecimal id,
                                        @RequestParam("subjectData") boolean subjectData,
                                        @RequestParam("createUserData") boolean createUserData,
                                        @RequestParam("materialData") boolean materialData);

    /**
     * 通过ID串，查询模块列表
     * @param ids
     * @param subjectData
     * @param createUserData
     * @param materialData
     * @return
     */
    @RequestMapping(contextPath + "/findCouMouldByIds")
    List<Map<String,Object>> findCouMouldByIds(@RequestParam("ids") String ids,
                                               @RequestParam("subjectData") boolean subjectData,
                                               @RequestParam("createUserData") boolean createUserData,
                                               @RequestParam("materialData") boolean materialData);

    /**
     * 多条件是查询模块列表
     * @param condition 查询条件
     * @param subjectData 设置专业数据
     * @param createUserData 设置创建人数据
     * @param materialData 设置素材数据
     * @return List<CouMould>
     */
    @RequestMapping(contextPath + "/findCouMouldList")
    List<Map<String,Object>> findCouMouldList(@RequestBody Map<String, Object> condition,
                                              @RequestParam("subjectData") boolean subjectData,
                                              @RequestParam("createUserData") boolean createUserData,
                                              @RequestParam("materialData") boolean materialData);

    /**
     * 分页查询模块数据
     * @param condition 查询条件
     * @param currentPage
     * @param subjectData 设置专业数据
     * @param createUserData 设置创建人数据
     * @param materialData 设置素材数据
     * @return PageInfo<CouMould>
     */
    @RequestMapping(contextPath + "/findCouMouldPage")
    Map<String,Object> findCouMouldPage(@RequestBody Map<String, Object> condition,
                                        @RequestParam(value = "currentPage", required = false, defaultValue = "1") int currentPage,
                                        @RequestParam("subjectData") boolean subjectData,
                                        @RequestParam("createUserData") boolean createUserData,
                                        @RequestParam("materialData") boolean materialData);
}
